/**
 * Created by iwm on 2017/1/24.
 */
/**
 * Created by iwm on 2017/1/23.
 */
$(document).ready(function () {
    btnHandle();
    function btnHandle() {
        $("#search").click(function () {
            var userid = $("#userid").val();
            $.ajax({
                url: '/user/getcoupon',
                timeout: 100000,
                type: 'get',
                dataType: 'json',
                data: {
                    user_id: userid,
                    home: true
                },
                success: function (rs) {
                    console.log(rs.errno);
                    if (rs.errno != 0) {
                        toastr.error(rs.errmsg);
                        return false;
                    }
                    //console.log(rs.data[0].address)
                    $('#addresstable').bootstrapTable('load', rs.data);
                    //$('#addresstable').bootstrapTable({
                    //data:rs.data
                    //});

                },
                error: function () {
                    toastr.error('系统错误');
                }
            });
        });
    }
});